﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace b7.Models
{
    public class RegisterModel
    {
        [Required(ErrorMessage = "Tai Khoan Khong Duoc Trong")]
        [StringLength(20, ErrorMessage = "Tai khoan it nhat 5 ky tu va nho hon 20 ky tu.", MinimumLength = 5)]
        [RegularExpression("[a-zA-Z0-9]*", ErrorMessage = "tai khoan khong duoc dung ky tu")]
        public string UserName { get; set; }

        [Required(ErrorMessage = "Họ tên Khong Duoc Trong")]
        [StringLength(20, ErrorMessage = "họ tên it nhat 5 ky tu va nho hon 20 ky tu.", MinimumLength = 5)]
        [RegularExpression("[a-zA-Z0-9]*", ErrorMessage = "tai khoan khong duoc dung ky tu")]
        public string FullName { get; set; }

        [RegularExpression(@"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}", ErrorMessage = "Email is is not valid.")]
        [DataType(DataType.EmailAddress)]
        public string Email { get; set; }

        [Required(ErrorMessage = "Mat khau khong duoc trong")]
        [StringLength(20, ErrorMessage = "Mat khau it nhat 5 ky tu va nho hon 20 ky tu.", MinimumLength = 5)]
        [RegularExpression("[a-zA-Z0-9]*", ErrorMessage = "mat khau khong duoc dung ky tu")]
        public string Password { get; set; }

        [DisplayFormat(DataFormatString = "{0:HH:mm-dd/MM/yyyy}", ApplyFormatInEditMode = true)]
        [Required(ErrorMessage = "chua nhap ngay sinh")]
        public DateTime Ngaysinh { get; set; }

        [Display(Name = "Gioi tinh")]
        [Required(ErrorMessage = "chua nhap gioi tinh")]
        public string Sex { get; set; }

        [Display(Name = "CMTND")]
        [Required(ErrorMessage = "chua nhap chung minh thu nhan dan")]
        public string CMTND { get; set; }

        [Display(Name = "Dia chi")]
        [Required(ErrorMessage = "chua nhap dia chi")]
        public string Adress { get; set; }

        [Display(Name = "Điện thoại")]
        public string PhoneNumber { get; set; }

        [Compare("Password", ErrorMessage = "Nhap lai lai mat khau khong dung.")]
        public string ConfirmPassword { get; set; }

    }
}